import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 邓大帅
 * Date: 2022-11-16
 * Time: 10:48
 */
public class PrintNum {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int num = input.nextInt();
        while(num != 0){
            System.out.println(num % 10);
            num /= 10;
        }
    }
}
